package com.zhijian.warehouse.manage.entity.vo.response;

import com.zhijian.warehouse.manage.enums.ProductEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Objects;

/**
 * 产品 回显vo
 *
 * @author auto
 * @version 1.0
 * @date 2024-10-12 16:56:24
 */
@Getter
@Api(tags = "产品回显vo")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProductVo implements Serializable {

    private static final long serialVersionUID = -1;

    /**
     * 主键ID
     */
    @ApiModelProperty("主键ID")
    private Long id;

    /**
     * 编码
     */
    @ApiModelProperty("编码")
    private String number;

    /**
     * 名称
     */
    @ApiModelProperty("名称")
    private String name;

    /**
     * 型号
     */
    @ApiModelProperty("型号")
    private String model;

    /**
     * 品类ID
     */
    @ApiModelProperty("品类ID")
    private Long categoryId;
        /**
     * 品类ID
     */
    @ApiModelProperty("品类")
    private String categoryName;

    /**
     * 单位ID
     */
    @ApiModelProperty("单位ID")
    private Long unitId;

    /**
     * 仓库ID
     */
    @ApiModelProperty("仓库ID")
    private Long warehouseId;

    @ApiModelProperty("所在仓库")
    private String warehouseName;

    /**
     * 领用时限限制天
     */
    @ApiModelProperty("领用时限限制天")
    private Integer limitDay;

    /**
     * 领用时限限制天
     */
    @ApiModelProperty("领用时限限制天 同 limitDay")
    private Integer drawDay;

    /**
     * 可领用个人用户ID串，以英文逗号隔开
     */
    @ApiModelProperty("可领用个人用户ID串，以英文逗号隔开")
    private String userIds;

    /**
     * 可领用部门ID串，以英文逗号隔开
     */
    @ApiModelProperty("可领用部门ID串，以英文逗号隔开")
    private String groupIds;

    /**
     * 安全库存
     */
    @ApiModelProperty("安全库存")
    private Integer safetyStock;

    /**
     * 发卡状态，1：已发卡，0：未发卡
     */
    @ApiModelProperty("发卡状态，1：已发卡，0：未发卡")
    @Deprecated
    private Byte cardStatus;

    /**
     * 发卡状态字符串
     */
    @ApiModelProperty("发卡状态字符串")
    private String cardStatusStr;

    /**
     * 领用状态，1：已领用，0：在库
     */
    @ApiModelProperty("领用状态，1：已领用，0：在库")
    private Byte useStatus;

    /**
     * 领用状态字符串
     */
    @ApiModelProperty("领用状态字符串")
    private String useStatusStr;

    /**
     * 状态，1：正常，2：故障，3：作废
     */
    @ApiModelProperty("状态，1：正常，2：故障，3：作废")
    private Byte status;

    /**
     * 状态字符串
     */
    @ApiModelProperty("状态字符串")
    private String statusStr;

    /**
     * 备注
     */
    @ApiModelProperty("备注")
    private String note;

    /**
     * RFID编码
     */
    @ApiModelProperty("RFID编码")
    private String rfId;

    /**
     * 条码
     */
    @ApiModelProperty("条码")
    private String barCode;

    /**
     * 状态，1：启用，0：禁用
     */
    @ApiModelProperty("条码 绑定状态，0：未绑定 1 ：绑定")
    private Integer barCodeStatus;

    /**
     * RFID 绑定状态 0 = 未绑定 1 = 已绑定
     */
    @ApiModelProperty("RFID 绑定状态 0 = 未绑定 1 = 已绑定")
    private Integer rfStatus;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    private String createTime;

    /**
     * 创建人ID
     */
    @ApiModelProperty("创建人ID")
    private Long createUserId;

    /**
     * 创建人姓名
     */
    @ApiModelProperty("创建人姓名")
    private String createUserName;

    /**
     * 修改时间
     */
    @ApiModelProperty("修改时间")
    private String updateTime;

    /**
     * 修改人ID
     */
    @ApiModelProperty("修改人ID")
    private Long updateUserId;

    /**
     * 修改人姓名
     */
    @ApiModelProperty("修改人姓名")
    private String updateUserName;
    @ApiModelProperty("单位")
    private String unitName;
    @ApiModelProperty("小数位")
    private Integer unitFraction;
    /**
     * 是否删除
     */
    @ApiModelProperty("是否删除 0 = 未删除 1 = 已删除")
    private Integer isDelete;

    @ApiModelProperty("可领用人")
    private String userName;

    @ApiModelProperty("可领用部门")
    private String groupName;

    @ApiModelProperty("计划归还时间")
    private String planBackTime;

    public void setCardStatusStr(String cardStatusStr) {
        this.cardStatusStr = cardStatusStr;
    }

    public void setUseStatusStr(String useStatusStr) {
        this.useStatusStr = useStatusStr;
    }

    public void setStatusStr(String statusStr) {
        this.statusStr = statusStr;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public void setUnitId(Long unitId) {
        this.unitId = unitId;
    }

    public void setWarehouseId(Long warehouseId) {
        this.warehouseId = warehouseId;
    }

    public void setLimitDay(Integer limitDay) {
        this.limitDay = limitDay;
    }

    public void setUserIds(String userIds) {
        this.userIds = userIds;
    }

    public void setGroupIds(String groupIds) {
        this.groupIds = groupIds;
    }

    public void setSafetyStock(Integer safetyStock) {
        this.safetyStock = safetyStock;
    }

    public void setCardStatus(Byte cardStatus) {
        this.cardStatus = cardStatus;
        if (Objects.isNull(cardStatus)) {
            this.cardStatusStr = null;
            return;
        }
        ProductEnum.CardStatusEnum lineEnum = ProductEnum.CardStatusEnum.getByCode(cardStatus.intValue());
        this.cardStatusStr = Objects.nonNull(lineEnum) ? lineEnum.getDesc() : null;
    }

    public void setUseStatus(Byte useStatus) {
        this.useStatus = useStatus;
        if (Objects.isNull(useStatus)) {
            this.useStatusStr = null;
            return;
        }
        ProductEnum.UseStatusEnum lineEnum = ProductEnum.UseStatusEnum.getByCode(useStatus.intValue());
        this.useStatusStr = Objects.nonNull(lineEnum) ? lineEnum.getDesc() : null;
    }

    public void setStatus(Byte status) {
        this.status = status;
        if (Objects.isNull(status)) {
            this.statusStr = null;
            return;
        }
        ProductEnum.StatusEnum lineEnum = ProductEnum.StatusEnum.getByCode(status.intValue());
        this.statusStr = Objects.nonNull(lineEnum) ? lineEnum.getDesc() : null;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public void setRfId(String rfId) {
        this.rfId = rfId;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public void setCreateUserId(Long createUserId) {
        this.createUserId = createUserId;
    }

    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public void setUpdateUserId(Long updateUserId) {
        this.updateUserId = updateUserId;
    }

    public void setUpdateUserName(String updateUserName) {
        this.updateUserName = updateUserName;
    }
}
